<?php 
/** @var TurnRow */
$turnRow = $this->turn;

$name = $turnRow->getName();
$action = 'Редактирование';
$submit = 'Изменить';
if (!$name) {
	$action = 'Создание';
	$submit = 'Создать';
}

/** @var GroupsRow */
$groupRow = $this->group;
$groupId = $groupRow->getId();
?>

<div class="head"><?php echo $action; ?> очереди</div>
<div class="cont_body" style="padding: 10px">
    <?php if ($this->error) : ?>
        <div class="msg"><?php echo $this->error; ?></div>
    <?php endif; ?>
    <form class="form-horizontal" id="form" method="post">
    <input type='hidden' name='group_id' value='<?php echo $groupId;?>' />
    <fieldset>
        <div class="control-group">
        <label class="control-label" for="trunk_name">Название очереди</label>
        <div class="controls">
            <input type="text" class="input-xlarge" id="trunk_name" name="name" default="<?php echo $name; ?>">
        </div>
        </div>
        
        <div class="control-group">
            <label class="control-label" for="time">Время</label>
            <div class="controls">
                <textarea id="time" name="time" style="height: 120px; width: 120px;"><?php 
					$times = $turnRow->getTimes();
					foreach ($times as $time) {
						echo $time . "\n";
					}
                ?></textarea>
            </div>
        </div>
        
        <div class="form-actions">
            <input type="submit" id="send" class="btn btn-primary" value="<?php echo $submit; ?>" />
            <div class="progress" id="box_progress"></div>
        </div>
    </fieldset>
    </form>
</div>
<div class="clear"></div>

